package com.xqit.ydzhkt.answer.controller;

import com.github.pagehelper.PageHelper;
import com.xqit.ydzhkt.answer.service.ListQuestionService;
import com.xqit.ydzhkt.entity.QuestionEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Janus on 2020/6/9
 */
@RestController
@RequestMapping("/listAnswer")
@Api(tags = "查看回答")
public class ListQuestionController {
    @Autowired
    private ListQuestionService listQuestionService;

    @ApiOperation("查询全部问题")
    @GetMapping("/listQuestion")
    public List<QuestionEntity> listQuestion( @RequestParam(defaultValue = "1",value = "pageNum") Integer pageNum,@RequestParam(defaultValue = "2",value = "pageSize") Integer pageSize){
        PageHelper.startPage(pageNum,pageSize);
        List<QuestionEntity> question = listQuestionService.listQuestion();
        return question;



    }
}
